package o;

import android.util.Log;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;
import java.io.Writer;

@RestrictTo({d.ॱ})
public class gy extends Writer {
    private StringBuilder ˏ = new StringBuilder(DnsConfig.MAX_CACHE_ENTRIES);
    private final String ॱ;

    public gy(String str) {
        this.ॱ = str;
    }

    public void close() {
        ˎ();
    }

    public void flush() {
        ˎ();
    }

    public void write(char[] cArr, int i, int i2) {
        for (int i3 = 0; i3 < i2; i3++) {
            char c = cArr[i + i3];
            if (c == '\n') {
                ˎ();
            } else {
                this.ˏ.append(c);
            }
        }
    }

    private void ˎ() {
        if (this.ˏ.length() > 0) {
            Log.d(this.ॱ, this.ˏ.toString());
            this.ˏ.delete(0, this.ˏ.length());
        }
    }
}
